<?php
if(!isset($AppUI->id)) {
	redirect(isset($_SESSION[SESSION_BACKURL]) ? $_SESSION[SESSION_BACKURL] : HOST_BACKEND);
}
/*destroy codeigniter session */
$arrSession = $this->session->all_userdata();
if(isset($arrSession)) {
    $this->session->sess_destroy();
}
/*destroy session php*/
$arrSession = isset($_SESSION) ? $_SESSION : null;
if(isset($arrSession)) {
    foreach($arrSession as $key=>$val) {
        if(!in_array($key, array(SESSION_MESSAGE,SESSION_ERROR,SESSION_BACKURL))) {
            unset($_SESSION[$key]);
        }
    }
}
redirect(HOST_BACKEND);
